home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / cottageofdoomsetup1.0.exe / {app} / Install.iss (.txt) < prev    next >
Encoding:
Inno Setup Script  |  2008-02-04  |  5.2 KB  |  105 lines

  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3. [Setup]
  4. AppName=Cottage Of Doom
  5. AppVerName=Cottage Of Doom 1.0
  6. AppPublisher=Alex May
  7. AppPublisherURL=http://sourceforge.net/projects/catrpg
  8. AppSupportURL=http://sourceforge.net/projects/catrpg
  9. AppUpdatesURL=http://sourceforge.net/projects/catrpg
  10. DefaultDirName={pf}\Cottage Of Doom
  11. DefaultGroupName=Cottage Of Doom
  12. AllowNoIcons=yes
  13. LicenseFile=C:\Project\neoneko\CottageOfDoom\CottageOfDoom\gpl.txt
  14. InfoAfterFile=C:\Project\neoneko\CottageOfDoom\CottageOfDoom\readme.txt
  15. OutputBaseFilename=cottageofdoomsetup1.0
  16. Compression=lzma
  17. SolidCompression=yes
  18. [Languages]
  19. Name: english; MessagesFile: compiler:Default.isl
  20. [Tasks]
  21. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  22. [Files]
  23. Source: C:\Project\neoneko\CottageOfDoom\CottageOfDoom\DoomCottage.exe; DestDir: {app}; Flags: ignoreversion
  24. Source: C:\Project\neoneko\CottageOfDoom\CottageOfDoom\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
  25. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  26. [Icons]
  27. Name: {group}\Cottage Of Doom; Filename: {app}\DoomCottage.exe; WorkingDir: {app}\; Tasks: ; Languages: ; IconFilename: {app}\doomcottage.ico
  28. Name: {group}\Cottage Of Doom (Vista); Filename: {app}\DoomCottage-VistaCompatible.exe; WorkingDir: {app}\; Tasks: ; Languages: ; IconFilename: {app}\doomcottage.ico
  29. Name: {group}\{cm:UninstallProgram,Cottage Of Doom}; Filename: {uninstallexe}
  30. Name: {commondesktop}\Cottage Of Doom; Filename: {app}\DoomCottage.exe; Tasks: desktopicon; WorkingDir: {app}\; IconFilename: {app}\doomcottage.ico
  31. [Run]
  32. Filename: {app}\DoomCottage-VistaCompatible.exe; Description: {cm:LaunchProgram,Cottage Of Doom}; Flags: nowait postinstall skipifsilent
  33. [Code]
  34.   dotnetRedistPath: string;
  35.   downloadNeeded: boolean;
  36.   dotNetNeeded: boolean;
  37.   memoDependenciesNeeded: string;
  38. procedure isxdl_AddFile(URL, Filename: PChar);
  39. external 'isxdl_AddFile@files:isxdl.dll stdcall';
  40. function isxdl_DownloadFiles(hWnd: Integer): Integer;
  41. external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
  42. function isxdl_SetOption(Option, Value: PChar): Integer;
  43. external 'isxdl_SetOption@files:isxdl.dll stdcall';
  44. const
  45.   dotnetRedistURL = 'http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe';
  46.   // local system for testing...
  47.   // dotnetRedistURL = 'http://192.168.1.1/dotnetfx.exe';
  48. function InitializeSetup(): Boolean;
  49. begin
  50.   Result := true;
  51.   dotNetNeeded := false;
  52.   // Check for required netfx installation
  53.   //if (not GetUserDefaultLangID() = 'English') then begin
  54.         //msgbox('Language Is Not English');
  55.   //end;
  56.   if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
  57.     dotNetNeeded := true;
  58.     if (not IsAdminLoggedOn()) then begin
  59.       MsgBox('Cottage Of Doom needs the Microsoft .NET Framework 2.0 to be installed by an Administrator', mbInformation, MB_OK);
  60.       Result := false;
  61.     end else begin
  62.       memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework 2.0' #13;
  63.       dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
  64.       if not FileExists(dotnetRedistPath) then begin
  65.         dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
  66.         if not FileExists(dotnetRedistPath) then begin
  67.           isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
  68.           downloadNeeded := true;
  69.         end;
  70.       end;
  71.       SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
  72.     end;
  73.   end;
  74. function NextButtonClick(CurPage: Integer): Boolean;
  75.   hWnd: Integer;
  76.   ResultCode: Integer;
  77. begin
  78.   Result := true;
  79.   if CurPage = wpReady then begin
  80.     hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
  81.     // don't try to init isxdl if it's not needed because it will error on < ie 3
  82.     if downloadNeeded then begin
  83.       isxdl_SetOption('label', 'Downloading Microsoft .NET Framework 2.0');
  84.       isxdl_SetOption('description', 'Cottage Of Doom needs to install the Microsoft .NET Framework 2.0. Please wait while Setup is downloading extra files to your computer.');
  85.       if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
  86.     end;
  87.     if (Result = true) and (dotNetNeeded = true) then begin
  88.       if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
  89.         // handle success if necessary; ResultCode contains the exit code
  90.         if not (ResultCode = 0) then begin
  91.           Result := false;
  92.         end;
  93.       end else begin
  94.         // handle failure if necessary; ResultCode contains the error code
  95.         Result := false;
  96.       end;
  97.     end;
  98.   end;
  99. function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
  100.   s: string;
  101. begin
  102.   if memoDependenciesNeeded <> '' then s := s + 'Dependencies that will be automatically downloaded And installed:' + NewLine + memoDependenciesNeeded + NewLine;
  103.   s := s + MemoDirInfo + NewLine + NewLine;
  104.   Result := s
  105.